package cn.fengwoo.springBoot.dao;

import cn.fengwoo.springBoot.utils.JdbcPageUtil;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by fangdaji on 2018/1/18.
 */
@Repository
public class UserDao {

    @Resource
    private JdbcTemplate JdbcTemplate;

    public List<Map<String, Object>> select(){
        String sql = "select * from s_user where name = ?";
        //List<Map<String, Object>> mapList = JdbcTemplate.queryForList(sql, "13420910327");

        List<Map<String, Object>> resultList =
                JdbcPageUtil.queryForList(sql,JdbcTemplate,1,1,new Object[]{"13420910327"});

        return resultList;
    }

}
